import React from 'react';
import './App.css';
import Header from './common/header/index'
import TongLan from './common/tonglan/tonglan'
import Info from './common/Info/Info'
import {Content,ContentLeft,ContentRight} from './style'
import {BrowserRouter,Route} from 'react-router-dom'
import Article from './pages/article/article'
import Share from './pages/share/share'
import {connect} from 'react-redux'
import CateContent from './pages/cateContent/cateContent'
import { BackTop } from 'antd';
import {GlobalFont} from './static/iconfont/iconfont'
import {GlobalStyle} from './style'
import Detail from './pages/Detail/Detail'
import Time from './pages/time/Time'
import SearchResult from './pages/searchResult/searchResult'
class App extends React.Component{
    constructor(){
      super();
      this.state={

      }
    }
  render(){
  return (
    <div className="App">
      <GlobalFont></GlobalFont>
      {/* <GlobalStyle></GlobalStyle> */}
      <BrowserRouter>
      <Header></Header>
      <TongLan></TongLan>
      <div className='container'>
      <Content className='row'>
        <ContentLeft className='col-md-4'>
          <Info></Info>
        </ContentLeft>
        <ContentRight className='col-md-8'>
              <Route path='/myblog/' exact component={Article}></Route>
              <Route path='/myblog/share' exact component={Share}></Route>
              <Route path={"/myblog/categore/:name"} exact component={CateContent}></Route>
              <Route path={'/myblog/article/detail/:id'} exact component={Detail}></Route>
              <Route path={'/myblog/article/time/:time'} exact component={Time}></Route>
              <Route path={'/myblog/article/searchResult'} exact component={SearchResult}></Route>
        </ContentRight>
        
      </Content>
      </div>
      <div>
        <BackTop />
        
        <strong style={{ color: 'rgba(64, 64, 64, 0.6)' }}></strong>
       
      </div>
      </BrowserRouter>
    </div>
  );
}
}
const mapStateToProps = (state)=>{
  //console.log(state.get('category').get("CategoryList"));
  return{
     categoryList:state.get('category').get('CategoryList')
  }
}

const mapDispatchToProps = (dispatch)=>{
  return{
     
  }
}
export default connect(mapStateToProps,mapDispatchToProps)(App);
